#ifndef SIMPLE_LOGGER_H_
#define SIMPLE_LOGGER_H_
#include "log4cplus/logger.h"
#include "log4cplus/loggingmacros.h"
#include <mutex>
#include <string>
#include <sstream>

#define __FILE_FUNC_LINE__ __FILE__, __FUNCTION__, __LINE__

enum LEVEL
{
    ALL,
    DEBUG,
    INFO,
    WARN,
    ERROR
};
/// @brief log4cplus的封装类
class SimpleLogger
{
public:
    static SimpleLogger *Get();
    void Init(LEVEL lvl = ALL, const char *dir = "./log/", const char *pattern = "%d{%m/%d/%y %H:%M:%S} %p - %m[%l]%n");
    void Init(std::string lvl, std::string dir, std::string pattern);
    log4cplus::Logger &LoggerRef();

private:
    log4cplus::Logger logger;
    std::mutex mtx_;
};

#endif